package by.kniazhych.core.server.local.logic.peaces {
	
	import by.kniazhych.core.data.game.PeacePosition;
	import by.kniazhych.core.server.local.logic.LogicController;
	
	/**
	 * ...
	 * @author Boutylin Mikhail
	 */
	
	 public class BlackPawn extends AbstractPeace{
		
		public function BlackPawn(controller:LogicController, type:uint) {
			super(controller, type);
		}
		
		override public function checkMotion(sP:PeacePosition, fP:PeacePosition):Boolean {
			if (sP.y - fP.y == -1 && sP.x - fP.x == 0 && super._checkCellClear(fP)) return true;
			if (sP.y - fP.y == -2 && sP.x - fP.x == 0 && sP.y == 1 && super._checkCellClear(fP) && 
			super._checkCellClear(new PeacePosition(fP.x, (fP.y + sP.y) / 2))) return true;
			if (sP.y - fP.y == -1 && Math.abs(sP.x - fP.x) == 1 && super._isWhitePeaceCell(fP)) return true;
			return false;
		}
		
	}

}